package com.ict.web.mapper;

import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ict.web.domain.Approval;
import com.ict.web.dto.ApprovalAddDto;
import com.ict.web.vo.ApprovalVo;
import com.ict.web.vo.OnLineVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 审核Mapper接口
 * 
 * @author ruoyi
 * @date 2022-02-24
 */
@Mapper
public interface ApprovalMapper extends BaseMapper<Approval>
{
    /**
     * 查询审核列表
     * 
     * @param
     * @return 审核集合
     */
    public List<ApprovalVo> selectExpertApprovalList(Long reviewTaskId);

    /**
     * 查询三方审批列表
     * @return
     */
    public List<ApprovalVo> selectThirdApprovalList(Long reviewTaskId);
    /**
     * 在线预审
     * @param proId
     *  @param createTime
     * @return
     */
    public List<OnLineVo> onLinePreliminary(@Param("proId") Long proId,@Param("createTime")String createTime);

    /**
     * 批量插入审核进程
     * @param list
     * @return
     */
    public int batchApproval(List<Approval> list);
    /**
     * 年度计划审核记录
     * @param projectId
     * @return
     */
    public Approval plan(Long projectId);

    /**
     * 查询审核记录
     * @param proId
     * @param approvalStatus
     * @param expertId
     * @param planId
     * @return
     */
    public Approval getApproval(@Param("proId") Long proId,@Param("approvalStatus")String approvalStatus,
                                @Param("expertId")Long expertId,@Param("planId")Long planId);

    /**
     * 查询最新一条审核记录
     * @param proId
     * @param approvalStatus
     * @param expertId
     * @param approvalType
     * @param createTime
     * @return
     */
    public Approval getApprovalByCreateTime(@Param("proId") Long proId,@Param("approvalStatus")String approvalStatus,
                                @Param("expertId")Long expertId,@Param("approvalType")String approvalType
                                ,@Param("createTime") LocalDateTime createTime);
}
